package com.mason.forum.utils;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 马拉圈
 * Date: 2023-10-02
 * Time: 2:37
 */
public class StringUtils {
    /**
     * 字符串全部都有长度才返回true
     * @param strings
     * @return
     */
    public static boolean hasLength(String... strings) {
        for(String x : strings) {
            x = x == null ? null : x.trim();
            if(!org.springframework.util.StringUtils.hasLength(x)) {
                return false;
            }
        }
        return true;
    }

    /**
     * 字符串全部都没有长度才返回true
     * @param strings
     * @return
     */
    public static boolean hasNotLength(String... strings) {
        for(String x : strings) {
            x = x == null ? null : x.trim();
            if(org.springframework.util.StringUtils.hasLength(x)) {
                return false;
            }
        }
        return true;
    }
}
